<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="signupForm">
						<input id="additiveId" name="additiveId" th:value="${scAdditive.additiveId}"  type="hidden">
							<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">生成任务id：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="produceTaskId" name="produceTaskId" th:value="${scAdditive.produceTaskId}" class="form-control" type="text">-->
								<!--</div>-->
							<!--</div>-->
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">原料进库：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<select id="purchaseId" name="purchaseId"  class="form-control">-->

									<!--</select>-->
								<!--</div>-->
							<!--</div>-->
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">班组：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<select id="marshalling" name="marshallingId"  class="form-control" >-->

									<!--</select>-->
								<!--</div>-->
							<!--</div>-->
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">数量：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="number" name="number" th:value="${scAdditive.number}" class="form-control" type="number">-->
								<!--</div>-->
							<!--</div>-->
							<div class="form-group">
								<label class="col-sm-3 control-label">
									原材料：
									<span style="color: #e7262a">*</span>
								</label>
								<div class="col-sm-8 product-list">
									<div>
										<a class="btn btn-primary" option="materialSelect">
											<i class="fa fa-plus"></i>
											<span>添加原材料</span>
										</a>
									</div>
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">称量人：</label>
								<div class="col-sm-8">
									<input id="weighingBy" name="weighingBy" th:value="${scAdditive.weighingBy}" class="form-control" type="text">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">复核人：</label>
								<div class="col-sm-8">
									<input id="checkBy" name="checkBy" th:value="${scAdditive.checkBy}" class="form-control" type="text">
								</div>
							</div>
														<div class="form-group">	
								<label class="col-sm-3 control-label">配添加剂时间：</label>
								<div class="col-sm-8">
									<input id="additiveDate" name="additiveDate" th:value="${scAdditive.additiveDate}" class="form-control" type="date">
								</div>
							</div>
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="createDate" name="createDate" th:value="${scAdditive.createDate}" class="form-control" type="text">-->
								<!--</div>-->
							<!--</div>-->
														<!--<div class="form-group">	-->
								<!--<label class="col-sm-3 control-label">：</label>-->
								<!--<div class="col-sm-8">-->
									<!--<input id="createBy" name="createBy" th:value="${scAdditive.createBy}" class="form-control" type="text">-->
								<!--</div>-->
							<!--</div>-->
																					<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
	</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" th:inline="javascript">
        function formatDate() {
            var useDate = [[${scAdditive.additiveDate}]];
            useDate = useDate.substring(0,10)
            $("#additiveDate").val(useDate)
        }

        // function getMarshallingId() {
        //     var typeId = [[${scAdditive.marshallingId}]]
        //     return typeId;
        // }

        function getPurchaseId() {
            var typeId = [[${scAdditive.purchaseId}]]
            return typeId;
        }
        function addMaterialsList() {
			var materials = [[${scAdditive.materials}]]
			for(var i in materials){
				var material = materials[i];
				var div = $('<div id="' + material.materialId + '" class="product-group"></div>');
				$(div).append('<span>' + material.materialName + '</span>');
				$(div).append('<input id="' + material.materialId + '" class="form-control" name="batch" value="' + material.batch + '" type="" required placeholder="原材料批次(必填)">');
				$(div).append('<input id="' + material.materialId + '" class="form-control" name="number" value="' + material.materialSize + '" type="" required placeholder="原材料数量(必填)">');
				$(div).append('<i class="fa fa-remove" option="materialDelete"></i>');
				$(".product-list").append(div);
			}
		}
	</script>
	<script type="text/javascript" th:src="@{/js/appjs/produce/scAdditive/edit.js}" src="/js/appjs/produce/scAdditive/edit.js">
	</script>
</body>
</html>
